package com.zrh.jserver;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;

@EnableDiscoveryClient
@SpringBootApplication
public class JServerApplication {
    public static void main(String[] args) throws InterruptedException {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(JServerApplication.class, args);
        while(true){
            String userName = applicationContext.getEnvironment().getProperty("dev.port");
            String userAge = applicationContext.getEnvironment().getProperty("dev.server");
            System.err.println("user name :" + userName + "; age: " + userAge);
            Thread.sleep(10000);
        }
    }
}
